import send from './http'
export default {
  /**
  * @param data
   * {
   *  name:string         任务名称 ("质检任务-2018-06-26 12:16:54")
   *  type: string        任务类型 (call、webchat)
   *  taskList: [string]  待执行列表 id数组
   *  query: { }          搜索条件 (taskList 和 query 二选一)
   *  rule:[ {}, {} ]     使用的规则列表
   * }
   *  status: string      任务状态 (ready、run、finish、fail)
   * @param session
   * @param callback
   */
  addTask (data) {
    let req = {
      data: data,
      action: 'app.autoqc.addTask'
    }
    return send.fetch(req, 'post')
  },
  // 查询通话质检列表 参数和老质检一样
  getQcListCall (data) {
    let req = {
      data: data,
      action: 'app.autoqc.getQcListCall'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 通话质检手动评分
   * @param data {}
   */
  submitOneManulQcCall (data) {
    let req = {
      data: data,
      action: 'app.autoqc.submitOneManulQcCall'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 在线质检手动评分
   * @param data {}
   */
  submitOneManulQcChat (data) {
    let req = {
      data: data,
      action: 'app.autoqc.submitOneManulQcChat'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部通话查询结果
   * @param {Object} data:{"page":页数,"limit":10}}
   */
  getQualityCheckQuaryResultAll (data) {
    const req = {
      data,
      action: 'app.autoqc.getQcResultListCall'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部通话查询结果详情
   * @param {Object} data:{fbce6280-7368-11e8-afd6-b78c18b6ebad(id)}}
   */
  QualityCheckQuaryResultAllDetails (data) {
    const req = {
      data,
      action: 'app.autoqc.getQcResultDetailCall'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部在线查询结果
   * @param {Object} data:{"page":页数,"limit":10}}
   */
  getQualityCheckQuaryResultWebAll (data) {
    const req = {
      data,
      action: 'app.autoqc.getQcResultListChat'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部在线查询结果详情
   * @param {Object} data:{"page":页数,"limit":10}}
   */
  getQualityCheckQuaryResultWebAllDetails (data) {
    const req = {
      data,
      action: 'app.autoqc.getQcResultDetailChat'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部详情复核
   * @param {Object} data:{ appeal: string 申诉id(可选，有的话需要去更新appeal)
    result：string  质检结果id
    supplementScore: int  -12
    manual:{"score":80,"comment":"重新评分"}}
   }
   */
  getQualityCheckQuaryResultCallAllCheckResult (data) {
    const req = {
      data,
      action: 'app.autoqc.recheckResultCall'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部详情复核
   * @param {Object} data:{ appeal: string 申诉id(可选，有的话需要去更新appeal)
    result：string  质检结果id
    supplementScore: int  -12
    manual:{"score":80,"comment":"重新评分"}}
   }
   */
  getQualityCheckQuaryResultWebAllCheckResult (data) {
    const req = {
      data,
      action: 'app.autoqc.recheckResultChat'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部通话放弃质检
   * @param {Object} data:{ids:[string]}  //通话质检结果id数组
   }
   */
  giveUpQualityCheckesRultAllCall (data) {
    const req = {
      data,
      action: 'app.autoqc.batchAbortResultCall'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部质检任务选择列表
   * @param {Object} data:{type:''}  //通话质检结果id数组
   }
   */
  getQualityCheckesRultAllTaskList (data) {
    const req = {
      data,
      action: 'app.autoqc.getLessTasks'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果全部在线放弃质检
   * @param {Object} data:{ids:[string]}  //通话质检结果id数组
   }
   */
  giveUpQualityCheckesRultAllWeb (data) {
    const req = {
      data,
      action: 'app.autoqc.batchAbortResultChat'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 查询任务列表
   * @param {Object} data:{"page":页数,"limit":10}}
   */
  getQualityCheckQuaryResultQueryTasks (data) {
    const req = {
      data,
      action: 'app.autoqc.queryTasks'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 质检结果  申诉中 查询结果
   * @param {Object} data:{"page":页数,"limit":10}}
   */
  getQualityCheckQuaryResultAppealList (data) {
    const req = {
      data,
      action: 'app.autoqc.getAppealList'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 申诉中 驳回申诉
   * @param
   */
  rejectAppeal (data) {
    const req = {
      data,
      action: 'app.autoqc.rejectAppeal'
    }
    return send.fetch(req, 'post')
  },
  /**
   * 申诉中 修改申诉状态为无效（当质检结果被放弃后用）
   * @param
   */
  IntelligentQualityAppealUpdateAppealStatus (data) {
    const req = {
      data,
      action: 'app.autoqc.updateAppealStatus'
    }
    return send.fetch(req, 'post')
  }
}
